package lab02.test25;

/**数字转换的异常处理。
 * 输入两个数，计算两个数想除的结果
 * （考虑除数为0的异常情况）。
 * */

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        int a, b;
        Scanner scanner = new Scanner(System.in);

        System.out.println("please input 1st int:");
        a = scanner.nextInt();
        System.out.println("please input 2st int:");
        b = scanner.nextInt();

        int c = 0;

        try {
            c = a / b;
        }catch (ArithmeticException e){
            System.out.println(" 除数为0 ！！！");
        }
        System.out.println("a" + "/" + "b" + "=" + c);
    }
}

